

local mt = ac.skill['死亡分裂']
mt.skill_type = "passive"
mt.model1 = [[Abilities\Weapons\ZigguratFrostMissile\ZigguratFrostMissile.mdl]]

function mt:on_add()
    local unit = self.owner
    self:gc(unit:event '单位-死亡'(function()
        local point = unit:get_point()
        local player = unit.owner_player
        local name = '分裂体'
        local model = unit:get_model()
        local level = unit.enemy_level
        local atk = unit:get('基础攻击')
        local def = unit:get('基础护甲')
        local smz = unit:get('生命上限')
        local spd = unit:get('移动速度')
        ac.wait(100,function()
            for a=1,5 do
                local unit = player:create_enemy('小怪模板',point)
                unit.not_update = true
                unit:set('基础攻击',atk)
                unit:set('生命上限',smz*0.5)
                unit:set('基础护甲',def)
                unit:set('移动速度',spd)
                unit:set_color(0xffff0000)
                unit:add_type('精英')
                unit:set_model(model)
                unit.ui_name = name
            end
        end)
    end))
end


